package framework.objects;


public class DynamicGameObjectsGroup<T extends DynamicGameObject> extends GameObjectsGroup<T> implements Updateable {

	public DynamicGameObjectsGroup(int capacity) {
		super(capacity);
	}
	
	@SuppressWarnings("unchecked")
	public void update(float deltaTime) {
		for (int i = 0; i < capacity; i++) {
			if (gameObjects[i] != null)  {
				((T)gameObjects[i]).update(deltaTime);
				if (!((T)gameObjects[i]).isAlive()) {
					gameObjects[i] = null;
				}
			}
		}
	}
	
}
